import $ from 'jquery'
import {Notice,} from "../utils/PopToast"

$(function () {
    $.ajax({
        url: 'http://124.221.121.145:9900/notice/getNewNotice',
        type: 'get',
        contentType: 'application/json',
        dataType: 'json',
        success: function (res) {
            console.log(res)
            const newNotice = res.data.noticeText
            const oldNotice = localStorage.getItem("noticeCache")
            if (!localStorage.getItem("isNotice") || oldNotice != newNotice) {
                localStorage.setItem("noticeCache", newNotice)
                Notice(newNotice)
            }
        }
    });


})
